﻿namespace EFS.RC.Survey.Controls.Common.Pages.Controls
{
	public class Control : System.Windows.Controls.UserControl
	{
		#region Properties
		/// Property UtilitiesService: Get, Set
		public EFS.RC.Survey.Controls.Utilities.utilitiesSoapClient utilitiesService = null;
		public EFS.RC.Survey.Controls.Utilities.utilitiesSoapClient UtilitiesService
		{
			get
			{
				// first time
				if (null == utilitiesService)
				{
					utilitiesService = EFS.RC.Survey.Controls.Common.WS.Setup.NewUtilitiesService;
				}

				// ok
				return utilitiesService;
			}
		}
		#endregion

		/// ConstructorNotAllowed
		protected void ConstructorNotAllowed()
		{
			// ignore in design tool
			if (!System.ComponentModel.DesignerProperties.IsInDesignTool)
			{
				throw new System.NotSupportedException("This constructor is not allowed programatically");
			}
		}

		/// Shows an error message
		public void ShowErrorMessage(System.String error)
		{
			EFS.RC.Survey.Controls.Common.Functions.ShowErrorMessage(error);
		}

		/// Shows an error message
		public void ShowErrorMessage(
			System.String customError,
			System.Exception ex)
		{
			EFS.RC.Survey.Controls.Common.Functions.ShowErrorMessage(customError, ex);
		}

		public void ShowSuccessMessage(System.String message)
		{
			EFS.RC.Survey.Controls.Common.Functions.ShowSuccessMessage(message);
		}
	}

}